<?php
require_once '../include/common.inc.php';
//require_once '../login/login_check.php';

if ($action == "0")
{
	$query="select * from package where id= '$id'";
    $result=$db->get_one($query);
}
?>

<script type="text/javascript">
function Juge(theForm){
 if(theForm.packagename.value==""){
  alert("套餐名称不能为空！");
  theForm.packagename.focus();
  return false;
 }
 if(theForm.money.value==""){
	  alert("套餐价格不能为空！");
	  theForm.money.focus();
	  return false;
	 }
 if(theForm.service.value==""){
	  alert("服务时间不能为空！");
	  theForm.service.focus();
	  return false;
	 }
}
</script>

<style type="text/css">
<!--
.STYLE1 {font-size: 24px;
	font-weight: bold;
}
-->
</style>

<div align="center">
  <p class="STYLE1">套餐信息</p>
</div>
<form id="packageform" name="packageform" method="post" action="save.php" onSubmit="return Juge(this)">
  <label>套餐名称：
  <input name="packagename" type="text" id="packagename"  value="<?php echo "$result[name]";?>"/>
  </label>必填
  <p>
    <label>套餐价格：
    <input name="money" type="text" id="money"  value="<?php echo "$result[money]";?>"/>
    </label>(元)必填
  </p>
  <p>
    <label>服务时间：
    <?php if ($action == "0"){?>
    	<input name="service" type="text" id="service" value="<?php echo "$result[service]";?>" />
    <?php }else{?>
    	<input name="service" type="text" id="service" value="1" />
    <?php }?>
    </label>
必填,以月为单位</p>
  <p>
    <label>套餐说明：
    <textarea name="memo" cols="80" rows="5" id="memo" value="<?php echo "$result[memo]";?>"></textarea>
    </label>
  </p>
  <p>
    <label>
    <input type="submit" name="Submit" value="提交" />
    </label>
    <?php if ($action == "0"){?>
    	<input name="actiontype" type="hidden" id="actiontype" value="0" />
    <?php }else{?>
    	<input name="actiontype" type="hidden" id="actiontype" value="1" />
    <?php }?>
    <input name="id" type="hidden" id="id" value="<?php echo "$result[id]";?>"/>
    <input name="tablename" type="hidden" id="tablename" value="package" />
  </p>
</form>